package code;

import java.util.Scanner;

public class QuestionNum_03_12 {
    public static void main(String[] args) {
        int result;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字:");
        int enterNum = sc.nextInt();
        if (enterNum >= 3){
            result = 2 * enterNum + 1;
        }else if (enterNum > -1 && enterNum <3){
            result = 2 * enterNum;
        }else{
            result = 2 *enterNum - 1;
        }
        System.out.println("计算的结果是:"+result);
    }
}
